<?php
// +-------------------------------------------------------------------------------
// | DingZone [ A Rapid Development Framework For Dingtalk ]
// +-------------------------------------------------------------------------------
// | 钉钉文件附件消息 v1.0
// |
// | Copyright (c) 2014-2018 http://www.heimalanshi.com All rights reserved.
// | Author : Jie
// | Date : 2018-08-09
// +-------------------------------------------------------------------------------

namespace ding\msg\chat;

/**
 * 文件会话消息
 *
 * @package ding\msg\chat
 */
class FileChatMsg extends ChatMsg {
    protected $mediaId;

    /**
     * 文件消息构造函数
     *
     * @param $mediaId
     */
    public function __construct($mediaId) {
        parent::__construct("file");
        $this->mediaId = $mediaId;
    }

    /**
     * 获取消息体
     * {
     *     "media_id": "mediaId"
     * }
     * @return array
     */
    public function getMsgContent() {
        return [
            'media_id' => $this->mediaId
        ];
    }

}
